package com.leifeng.demo.WindowDemo.controller;

import java.net.URL;
import java.util.ResourceBundle;

import com.leifeng.demo.WindowDemo.main.StageManager;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;

public class ThirdController implements Initializable {
	
    @FXML
    private Button btnVoidData;

    @FXML
    private Button btnCloseThis;

    @FXML
    void closeThis(ActionEvent event) {
		StageManager.STAGE.get("third").close();  
		StageManager.STAGE.remove("third");
    }

    @FXML
    void voidData(ActionEvent event) {
        SecondController secondControl=(SecondController) StageManager.CONTROLLER.get("secondController");  
        secondControl.setTranDataToIndex("第三个窗口的数据");  
        //如果本窗口还使用该控制器先不remove这个控制器;  
        StageManager.CONTROLLER.remove("secondController"); 
    }

	@Override
	public void initialize(URL location, ResourceBundle resources) {
		// TODO Auto-generated method stub
		
	}
}
